UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D3KkiF5khuATlfG2cm0PWm0Qmgne1DIcPqXZpDzdFDY='
WHERE
key_id = '5e2e948f5d64d76b847cbb09d130c47ed74f27cae9c29f1015d068c593f6e16b'
AND (
token = 'D3KkiF5khuATlfG2cm0PWm0Qmgne1DIcPqXZpDzdFDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)