UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hDKJXTIrPqJzbV0d5Z/aAQZrQb3JxIS/Fjg/s4QoWgc=' 
WHERE 
  key_id = '70a014bd240504d6b9b9e1706174475ed46828b55d7608dcd0a5b2ac48eaaa72' 
  AND (
    token = 'hDKJXTIrPqJzbV0d5Z/aAQZrQb3JxIS/Fjg/s4QoWgc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030