UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0VBRUfOp+B7H59FaDdmer8L0KGBNg7gzZIjYnRVJuII='
WHERE
key_id = '8c94d84a5c69cab5ac9627fec1c75bca199a7d5b88ba15c9ec51d102605f6565'
AND (
token = '0VBRUfOp+B7H59FaDdmer8L0KGBNg7gzZIjYnRVJuII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)