UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QAvWtdBkl6aJ1XeeM6NeSJG2PPR4BzH0Q/vaFvYE5as=' 
WHERE 
  key_id = '4c108bb4cadcc904a5c3c728267c72bb40e3ff711f433e8ba68941d484deb274' 
  AND (
    token = 'QAvWtdBkl6aJ1XeeM6NeSJG2PPR4BzH0Q/vaFvYE5as=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045