UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RDqYMpq/K7/ue1Xf/OsM1ZhqJtYRKWKZs7vNEwMFvwk=' 
WHERE 
  key_id = '6ec839858d0bb0249a140cd6de6442a23fff9833cedabb9c01ea37d7dc5f6905' 
  AND (
    token = 'RDqYMpq/K7/ue1Xf/OsM1ZhqJtYRKWKZs7vNEwMFvwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029