UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'awyOqpSR4FFbU8rrJ4AnH2vs54RQ3WZ18UsEd5c7D7g='
WHERE
key_id = '603417ad62f53c08c38fe84cd00ebd622fe437710261430487868de7245c331c'
AND (
token = 'awyOqpSR4FFbU8rrJ4AnH2vs54RQ3WZ18UsEd5c7D7g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)