UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2M4XLDZY46IJu+S6u2IziEZI9eiyBxk5VQ8nGIImrSk='
WHERE
key_id = '95fffeef98306acd46ddc247b7438264045058d6eb31beb51dceab7eb6d7d825'
AND (
token = '2M4XLDZY46IJu+S6u2IziEZI9eiyBxk5VQ8nGIImrSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)