UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PueNsTpX9iCLGXTp5FsfR848PbFtcnOjsWbBfMxq/MI='
WHERE
key_id = 'ee2b63f4880e2e70ddfd1b528889ab7dff31736b5090a1a46ca1042fbcb5073b'
AND (
token = 'PueNsTpX9iCLGXTp5FsfR848PbFtcnOjsWbBfMxq/MI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)