UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IDlVDpFFZGFhyY2eeSnwNO6ogEtgGvTmfWouh7g6yZQ='
WHERE
key_id = '074cdc302fb864e1b7d89f575cfc8227b1c7f0c45affdd73d54d8c49130c80e4'
AND (
token = 'IDlVDpFFZGFhyY2eeSnwNO6ogEtgGvTmfWouh7g6yZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)