UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'la9C5apOgqDDcpOrlRP2A554eSRIuh7eWfh4DOEChXg='
WHERE
key_id = 'dfd8007ee0890a041ef83f4c5730ca986a5fd42227c6315feb5bbd6009d9ac40'
AND (
token = 'la9C5apOgqDDcpOrlRP2A554eSRIuh7eWfh4DOEChXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)