UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ujRlOOPeI6xgR8sLAep9GA1ZKcKhQKZTH4MtrZ1fXtc=' 
WHERE 
  key_id = 'b49685c59898b7f30324f4f2847fc6bf7c70c69829ffc87c6bd6f8324ea1322d' 
  AND (
    token = 'ujRlOOPeI6xgR8sLAep9GA1ZKcKhQKZTH4MtrZ1fXtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033