UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zgp4IsgQ0SCyebEJZYvofJ9y1fMUHSnP5MD/ThNs5sE='
WHERE
key_id = '04b48e82dffa24027c64fb2b33234256ead6a3ab5e15d4b24eb1871f1e76fa4a'
AND (
token = 'zgp4IsgQ0SCyebEJZYvofJ9y1fMUHSnP5MD/ThNs5sE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)