UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f8U+jhxi5jnHZ/DTNmY42cGyAJbq0sxWTxTDgUOp7R8='
WHERE
key_id = 'abbcce8ff9043f49322231078965bce5eb5883b625f0c2ff0d8d3f464391ecfe'
AND (
token = 'f8U+jhxi5jnHZ/DTNmY42cGyAJbq0sxWTxTDgUOp7R8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)