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