UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L/b+brajs271o1JVPCSU+GczLbpRgypugdVRZTxWfP8='
WHERE
key_id = 'eaf99cb2d4fb86073b925caab1cd159f99d94f4e392355bbbab8a99576ced731'
AND (
token = 'L/b+brajs271o1JVPCSU+GczLbpRgypugdVRZTxWfP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)