UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bFELsTjGnPr2PX167aevdUfBZr2I/meSU+Bfic5dTfI='
WHERE
key_id = 'fd9a96b44dbf3727d9cb375734f6f2fcafbcbd689bb25f8f254787391a45d58d'
AND (
token = 'bFELsTjGnPr2PX167aevdUfBZr2I/meSU+Bfic5dTfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)