UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ct6LOmTZlfmFcLpd3xjarLR4X30sUwLA+trFpYrQA0k='
WHERE
key_id = '3b26c23f5f613f9618cdc3d092ec6f4717570bac322df860dbd104fd6d420d74'
AND (
token = 'ct6LOmTZlfmFcLpd3xjarLR4X30sUwLA+trFpYrQA0k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)