UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CjKlUXgJvXg3rm/lo0RrUcsC/mO04n8iVlkSDp/i7ZQ=' 
WHERE 
  key_id = '7d9865cedde30ee2fde83f18c63b0e679c6dadedceed7a9693aa2fbc7fab65ec' 
  AND (
    token = 'CjKlUXgJvXg3rm/lo0RrUcsC/mO04n8iVlkSDp/i7ZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039