UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '69C1Vi4oE+n4VJgLXcAgIpSAEoSOcI8KMbb0RIxYsR0=' 
WHERE 
  key_id = '528060ce34665b8b62d4f3c4befb8f3d65be0510141140c521cd5313d4c30821' 
  AND (
    token = '69C1Vi4oE+n4VJgLXcAgIpSAEoSOcI8KMbb0RIxYsR0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040