UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F6ft8ntmJ/s6jHv6dJvqm6oOfMxDNDdWtbgeHytd1QI='
WHERE
key_id = 'baa82fe68246208760908aafefef17cd0c5f670ecaa127995f80cb84f5994510'
AND (
token = 'F6ft8ntmJ/s6jHv6dJvqm6oOfMxDNDdWtbgeHytd1QI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)