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