UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Qe8e5AuK16R5atrza5MiAJbLJnS7HpRYttLj2PDiws=' 
WHERE 
  key_id = '697e1176b58c8812469172e50096349af4e93b09fd45caf8c00d3ceda2fc0ae9' 
  AND (
    token = '3Qe8e5AuK16R5atrza5MiAJbLJnS7HpRYttLj2PDiws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033