UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bSpwBVxPgKzgZpoOE3nUq8slWIXbe5zak2TfZ/oCWEA='
WHERE
key_id = 'b373b76047ecc41347153cb1be2200ac243a85eb7f57b73ae5138fac3aa3beeb'
AND (
token = 'bSpwBVxPgKzgZpoOE3nUq8slWIXbe5zak2TfZ/oCWEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)