UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qHEXJK7usxNkeXMAHq4f4BiysqAXvF9I0vF7UXgm6rM=' 
WHERE 
  key_id = '15edcce3c595d3deab0697167db3b6b431a265b0dd54762ff1990e9d55279fdf' 
  AND (
    token = 'qHEXJK7usxNkeXMAHq4f4BiysqAXvF9I0vF7UXgm6rM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016