UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j/6wiUQT2uD4/iuX07ULb7GSmmdfAxO10LIr3Fv9yZ0='
WHERE
key_id = 'bebdc320b5b573279acc23e2568e6aa4f62516dd25b0bc644c25b7551029e101'
AND (
token = 'j/6wiUQT2uD4/iuX07ULb7GSmmdfAxO10LIr3Fv9yZ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)