UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ZIudzLrc9eg5yvUfGpIxEKT6zkvaTUJf93YoGzUGYI='
WHERE
key_id = 'c8d6fc983d7e923cb265688e276cca1deb7d90a40ac6c6452a0338b625046ebf'
AND (
token = '+ZIudzLrc9eg5yvUfGpIxEKT6zkvaTUJf93YoGzUGYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)