UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PM5qjqBpNX4o6AKQ4Va7CmK46Rx/D0o3tFf4XL3a51Y='
WHERE
key_id = '4b20b5ca870a0b29db2ced43ef31f5547d577239370a8f3b90a637b93dc5f395'
AND (
token = 'PM5qjqBpNX4o6AKQ4Va7CmK46Rx/D0o3tFf4XL3a51Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)