UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/QBvuYE3GaAbbAiMhX/wdXfolLk1JQhKdpt+blJn5Gs=' 
WHERE 
  key_id = '3c5b910ea82fa133e075f9111cd382c34d0d2f8150220945edb5aa14f3dc8275' 
  AND (
    token = '/QBvuYE3GaAbbAiMhX/wdXfolLk1JQhKdpt+blJn5Gs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055