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